package com.cloudptt.wp.ui.more;
//Download by htp://www.codefans.net



import com.cloudptt.wp.R;
import com.cloudptt.wp.utils.Common;

import android.app.Activity;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.TextView;

public class VersionInfoActivity extends Activity implements OnClickListener {
	private TextView returnBtn; 
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
		Window window = getWindow();
		window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
		window.setStatusBarColor(getResources().getColor(R.color.app_theme_color_primary));
		super.onCreate(savedInstanceState);
		setContentView(R.layout.version);
		
		getActionBar().setBackgroundDrawable(getResources().getDrawable(R.color.app_theme_color_primary));
		getActionBar().hide();
		
		TextView versionText = (TextView)findViewById(R.id.versionText);
		String str = Common.getVersion(VersionInfoActivity.this);
		versionText.setText(str);
		
		ImageView iv = (ImageView) findViewById(R.id.back_up_icon);
		iv.setOnClickListener(this);
		TextView tv = (TextView) findViewById(R.id.title);
		tv.setText(R.string.about_us);
	}
	
	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		// TODO Auto-generated method stub
		
		if(android.R.id.home == item.getItemId()){
			finish();
			return true;
		}
		
		return super.onOptionsItemSelected(item);
	}
	
	public void onClick(View v) {
		int id = v.getId();
		if(id == R.id.back_up_icon) 
		{
			this.finish();
		}
	}

	public void login_back(View v) {     
		this.finish();
	}  
	
}
